<!DOCTYPE html>
<html>
<head th:include="cultivateWeb/header :: culHeaderCss">
</head>
<link rel="stylesheet" href="/css/certificateWeb/workNews/workNews.css">
<link type="text/css" href="/css/cultivateWeb/style/my.css" rel="stylesheet">
<link href="../static/css/bootstrap.min.css" rel="stylesheet">
<body>
<!-- 顶部导航 -->
<header th:include="cultivateWeb/header :: header"></header>
<div style="clear: both"></div>
<div style="background-color: #f7f7f7; ">
    <div class="container">
        <div class="row">
    <div style="height: 40px">
        <p style="line-height: 40px">当前位置：<a href="/cultivate/homepage">首页</a> > 个人信息</p>
    </div>
    <hr style="margin: 0 auto ;"/>
    <section style="display:flex;background:#F7F7F7;padding-top: 0">
        <div class="col-xs-3" style="height: 850px;padding:0;margin-right:10px;background-color: #fff">
            <ul id="personal_data">
                <li><a href="/cultivate/my">个人资料</a></li>
                <li><a href="/cultivate/myOrder">我的订单</a></li>
<!--                <li><a href="/cultivate/myClasss/myClasss">我的班级</a></li>-->
                <li><a href="/cultivate/myCourse">我的课程</a></li>
                <li><a href="/cultivate/myCoursePlan">我的课程计划</a></li>
                <li><a href="/cultivate/studyRecord">学习记录</a></li>
                <li onclick="recruit()"><a>我的简历</a></li>
                <li><a href="/cultivate/deliverRecord">投递记录</a></li>
                <li class="this"><a href="/cultivate/applyRecord">申请记录</a></li>
                <li><a href="/cultivate/myMessage">消息中心</a></li>
                <li><a href="/cultivate/myCertificates">我的证书</a></li>
                <li onclick="mock2(this)" data-type="2"><a>幼儿照护初级模拟考试</a></li>
                <li onclick="mock2(this)" data-type="1"><a>幼儿照护中级模拟考试</a></li>
                <li onclick="mock2(this)" data-type="0"><a>幼儿照护高级模拟考试</a></li>
            </ul>
        </div>
        <div class="col-xs-9" style="padding:0;background-color: #fff">
            <div id="news"></div>
            <div id="page" class="page"></div>

    </div>
        <div style="clear: both"></div>
    </section>
        </div>
    </div>
</div>
<!-- footer ------------------------------------------------------- -->
<div class="footer" th:include="cultivateWeb/header :: footer"></div>
<script type="text/javascript" src="/js/xlPaging.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<script type="text/javascript" src="/js/mobile.js"></script>
</body>
<script>
    $(function () {
        ajaxToken("/jzApi/user/selMyExaminationPointList", 'GET',
            {
                current: 1,
                number: 8,
                t: new Date()
            }, function (res) {
                if (res.pages == 0) {
                    $("#news").html('<div class="noData">暂无数据</div>');
                } else {
                    var list = res.records;
                    var news = '';
                    list.forEach(function (item, index) {
                        var a = '';
                        var b = '';
                        var c = '';
                        if (item.type == 0) {
                            b = '培训机构';
                        }

                        if (item.type == 1) {
                            b = '实训基地';
                        }
                        if (item.type == 2) {
                            b = '考评站';
                        }
                        if (item.type == 3) {
                            b = '实习就业单位'
                        }
                        if (item.type == 4) {
                            b = '培训考试点';
                        }
                        if (item.type == 5) {
                            b = '考核站点';
                        }
                        if (item.state == 0) {
                            a = '<span style="color: blue" id="state">待审核</span>';
                        }
                        if (item.state == 1) {
                            a = '<span style="color: green" id="state">已通过</span>';
                        }
                        if (item.state == 2) {
                            a = '<span style="color: red" id="state">未通过</span>';
                            c = '<div style="display: flex;justify-content: space-between">' +
                                '<div class="span_1" style="flex: 6"><span class="title_1">备注：</span><p style="color: red" class="title_2">' + item.remark + '</p></div>' +
                                '<div class="span_1" style="flex: 3;margin-top: 4px"><a href="#" class="my_btn" style="flex: 1;text-align: center;padding:2px 10px" onclick="edit(\'' + item.id + '\')" >修改</a></div>' +
                                '</div>'
                        }
                        if (item.state == 3) {
                            a = '<span style="color: grey" id="state">已停用</span>';
                        }
                        if (item.state == 9) {
                            a = '<span style="color: #2417ff" id="state">已删除</span>';
                        }
                        if (item.type == 0 || item.type == 3) {
                            news += '<div class="my_bg div_01">' +
                                '<div style="display: flex;justify-content: space-between">' +
                                '<div class="span_1" style="flex: 6"><span class="title_1">站点类型：</span><p id="type" class="title_2">' + b + '</p></div>' +
                                '<div class="span_1" style="flex: 3"><span class="title_1">审核状态：</span><p class="title_2">' + a + '</p></div>' +
                                '</div>' +
                                '<div style="display: flex;justify-content: space-between">' +
                                '<div class="span_1" style="flex: 6"><span class="title_1">站点名称：</span><p class="title_2">' + item.name + '</p></div>' +
                                '<div class="span_1" style="flex: 3"><span class="title_1">申请时间：</span><p class="title_2">' + item.applicantDate + '</p></div>' +
                                '</div>' +
                                c +
                                '</div>';
                        }

                    });
                    if (news == '') {
                        news = '<div class="noData">暂无数据</div>'
                    }
                    $("#news").html(news);
                    page(1, res.pages);
                }
            })
    })

    function page(num, tolPages) {
        $(".page").paging({
            nowPage: Number(num), // 当前页码
            pageNum: Number(tolPages), // 总页码
            buttonNum: 3, //要展示的页码数量
            canJump: 1,// 是否能跳转。0=不显示（默认），1=显示
            showOne: 0,//只有一页时，是否显示。0=不显示,1=显示（默认）
            callback: function (num) { //回调函数
                ajaxToken("/jzApi/user/selMyExaminationPointList", 'GET',
                    {
                        current: num,
                        number: 8,
                        t: new Date()
                    }, function (res) {
                            var list = res.records;
                            var news = '';
                            list.forEach(function (item, index) {
                                var a = '';
                                var b = '';
                                var c = '';
                                if (item.type == 0) {
                                    b = '培训机构'
                                }
                                if (item.type == 1) {
                                    b = '实训基地'
                                }
                                if (item.type == 2) {
                                    b = '考评站'
                                }
                                if (item.type == 3) {
                                    b = '实习就业单位'
                                }
                                if (item.type == 4) {
                                    b = '培训考试点'
                                }
                                if (item.type == 5) {
                                    b = '考核站点'
                                }
                                if (item.state == 0) {
                                    a = '<span style="color: blue" id="state">待审核</span>';
                                }
                                if (item.state == 1) {
                                    a = '<span style="color: green" id="state">已通过</span>';
                                }
                                if (item.state == 2) {
                                    a = '<span style="color: red" id="state">未通过</span>';
                                    c = '<div style="display: flex;justify-content: space-between">' +
                                        '<div class="span_1" style="flex: 6"><span class="title_1">备注：</span><p style="color: red" class="title_2">' + item.remark + '</p></div>' +
                                        '<div class="span_1" style="flex: 3;margin-top: 4px"><a href="#" class="my_btn" style="flex: 1;text-align: center;padding:2px 10px" onclick="edit(\'' + item.id + '\')" >修改</a></div>' +
                                        '</div>'
                                }
                                if (item.state == 3) {
                                    a = '<span style="color: grey" id="state">已停用</span>';
                                }
                                if (item.state == 9) {
                                    a = '<span style="color: #2417ff" id="state">已删除</span>';
                                }
                                if (item.type == 0 || item.type == 3) {
                                    news += '<div class="my_bg div_01">' +
                                        '<div style="display: flex;justify-content: space-between">' +
                                        '<div class="span_1" style="flex: 6"><span class="title_1">站点类型：</span><p class="title_2">' + b + '</p></div>' +
                                        '<div class="span_1" style="flex: 3"><span class="title_1">审核状态：</span><p class="title_2">' + a + '</p></div>' +
                                        '</div>' +
                                        '<div style="display: flex;justify-content: space-between">' +
                                        '<div class="span_1" style="flex: 6"><span class="title_1">站点名称：</span><p class="title_2">' + item.name + '</p></div>' +
                                        '<div class="span_1" style="flex: 3"><span class="title_1">申请时间：</span><p class="title_2">' + item.applicantDate + '</p></div>' +
                                        '</div>' +
                                        c +
                                        '</div>';
                                }
                            });
                            $("#news").html(news);
                    });
            }
        });
    }

    function edit(id) {
        location.href = "/cultivate/orgEdit?orgId=" + id
    }

</script>
</html>